home *** CD-ROM | disk | FTP | other *** search
- ;; WEFAX display code
-
- code_seg segment
- assume cs:code_seg,ds:code_seg,es:code_seg
-
- org 100H
- program proc far
- jmp go
-
- ;; Data here
-
- pixword dw 0
- row dw 0
- column dw 0
- columns dw 628
- colsync dw 624
- two dw 3
- olddat db 0
- skipit db 0
- shiftr db 7
- strmsg db 13,10,'Strike any key when you are ready',13,10,'$'
- vpixmap db 0,0,0,0,0,0,0,15 dup(14)
- normap db 0,0,2,3,6,4,5,7,8, 9,10,11,12,13,14,15
- sync db 1
- ;; Code here
-
- ;; print the startup message
- go: mov dx,offset strmsg
- mov ah,9
- int 21H
- ;; hold for a character
- chk: mov ah,01H
- int 16H
- cmp al,0
- je chk
- ;; read it
- getc: mov ah,0
- int 16H
- ;; have BIOS give us EGA, 640x350x16 colors
- mov ax,0010H
- int 10H
- ;;
- start: mov ax,0
- mov row,ax
- mov column,ax
- ;; wait until the DSP board says come and get it by changing the value
- ;; at i/o port 304H
- newpix: mov dx,304H
- in al,dx
- ;; has it changed?
- cmp al,olddat
- ;; no go wait for it to change
- je newpix
- mov olddat,al
- ;; yes read the value from i/o port 300H after checking to see if this
- ;; is the end of line column limit
- mov ax,columns
- cmp column,ax
- ;; last column, go check keyboard
- jge testc
- ;; no go get the next pixel
- mov dx,300H
- in ax,dx
-
- ;; shift the value to the right so that only the most significant 4 bits
- ;; are left and this is what we will display as a color (one of 16)
- mov cl,shiftr
- shr ax,cl
- cmp sync,1
- jl nsync
- cmp ax,0FH
- jle nsync
- mov bx,colsync
- cmp column,bx
- jl nsync
- jmp testc
- nsync: ;mov cl,2
- ;shr ax,cl
- ;mul two
- and ax,0FH
- mov si,ax
- mov al,es:normap[si]
- ;; set up for a pixel punching call to BIOS
- mov ah,0CH
- mov cx,column
- mov dx,row
- ;; draw the dot with BIOS service 10H subfunction 0CH
- int 10H
- ;; mov to the next column
- inc column
- ;; no go on and finish processing
- jmp newpix
- ;; Yes, set column to 0 and increment the row counter
- ;; AFTER you see if you struck a key? with BIOS service 16H
- testc: mov ah,01H
- int 16H
- ;; go see what it was if there is a character.
- jnz getit
- ;; are we at the bottom of the screen?
- goon: mov column,0
- goon2: ;cmp skipit,1
- ;xor skipit,1
- ;jne incr
- ;jmp newpix
- incr: inc row
- ;; last row?
- cmp row,350
- ;; no go and get the first pixel of the new line
- je newr
- jmp newpix
- ;; yes, set row to 0 and go get the first pixel of the new screen
- newr: mov row,0
- jmp newpix
- ;; following processes keystrokes
- getit: mov ah,0
- ;; read it with BIOS service 16H
- int 16H
- ;; shift the picture right one pixel?
- tstr: cmp al,'r'
- jne tstl
- mov column,1
- jmp goon2
- ;; shift the picture left one pixel?
- tstl: cmp al,'l'
- jne tstw
- newpl: mov dx,304H
- in al,dx
- ;; has it changed?
- cmp al,olddat
- ;; no go wait for it to change
- je newpl
- mov olddat,al
- jmp testc
- ;; make the picture wider?
- tstw: cmp al,'w'
- jne tstn
- inc columns
- inc colsync
- jmp testc
- ;; Make the picture narrower?
- tstn: cmp al,'n'
- jne tsts
- dec columns
- dec colsync
- jmp testc
- ;; turn off sync ?
- tsts: cmp al,'s'
- jne tstu
- xor sync,1
- jmp testc
- ;; make the signal more significant?
- tstu: cmp al,'u'
- jne tstd
- dec shiftr
- jmp testc
- ;; make the signal less significant?
- tstd: cmp al,'d'
- jne tstq
- inc shiftr
- jmp testc
- ;; quit?
- tstq: cmp al,'q'
- jne tsth
- jmp stop
- ;; hold still ?
- tsth: cmp al,'h'
- jne tstz
- hold: mov ah,0
- int 16H
- jmp testc
- ;; bye ya'll
- tstz: cmp al,'z'
- je top
- jmp testc
- top: mov row,0
- jmp testc
- stop: mov ax,3
- int 10H
- mov ah,0
- int 21H
- program endp
- code_seg ends
- end program
-
-